﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using S4Store.Domain;
using S4Store.Domain.TelSaleKpi;

namespace S4Store.Models.TelSaleKpi
{
    public class IndexModel : BaseReportModel
    {
        public IndexModel()
        {
            MonthDayData = new List<CarBrandTelSaleDayData>();
        }

        public List<CarBrandTelSaleDayData> MonthDayData { get; set; }

        public DataConfirmStatus? GetDayStatus(int year,int month,int day)
        {
            var m= MonthDayData.FirstOrDefault(t =>t.Date.Year==year&&t.Date.Month==month&& t.Date.Day == day );
            if (m == null)
            {
                return null;
            }
            else if (m.IsConfirmed)
            {
                return DataConfirmStatus.Confirmed;
            }else{
                return DataConfirmStatus.None;
            }
        }
    }
}